import Layout from '@/layout'
/* 
常量路由
包括登陆/404/首页
*/
export const constantRoutes = [
  {
    path: '/login',
    component: () => import('@/views/login'),
    hidden: true
  },

  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },

  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [
      {
        path: 'dashboard',
        name: 'Dashboard',
        component: () => import('@/views/dashboard'),
        meta: { title: '首页', icon: 'dashboard' }
      }
    ]
  },
]

/**
 * 定义动态路由（异步路由）
 */

export const asyncRoutes = [
  // 权限控制
  {
    path: "/acl",
    name: "Acl",
    component: Layout,
    redirect: "/acl/user/list",
    meta: {
      title: "权限管理",
      icon: "el-icon-lock",
    },
    children: [
      {
        name: "User",
        path: "/acl/user/list",
        component: () => import("@/views/acl/user"),
        meta: {
          title: "用户管理",
        },
      },
      {
        name: "Role",
        path: "/acl/role/list",
        component: () => import("@/views/acl/role"),
        meta: {
          title: "角色管理",
        },
      },
      {
        name: "RoleAuth",
        path: "/acl/role/auth",
        component: () => import("@/views/acl/role/roleAuth"),
        hidden: true,
        meta: {
          title: "角色授权",
          activeMenu: "/acl/role/list",
        },
      },
      {
        name: "Permission",
        path: "/acl/permission/list",
        component: () => import("@/views/acl/permission/index.vue"),
        meta: {
          title: "菜单管理",
        },
      },
    ],
  },
  // 品牌管理
  {
    name: 'Product', // 这个name属性必须和我的一样,按下不表
    path: '/product',
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '商品管理', 
      icon: 'el-icon-goods', 
    },
    children: [
      {
        name: 'Trademark', // 这个name属性必须和我的一样,按下不表
        path: 'trademark/list',
        component: () => import('@/views/product/trademark'),
        meta: {
          title: '品牌管理'
        }
      },
      {
        name: 'Attr', // 这个name属性必须和我的一样,按下不表
        path: 'attr/list',
        component: () => import('@/views/product/attr'),
        meta: {
          title: '平台属性管理'
        }
      },
    ]
  },

];

//  任意路由(未匹配的路由)
export const anyRoute = { path: '*', redirect: '/404', hidden: true }

  




